package com.chlitina.store.modules.cash.dao;

import java.util.List;

import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Component;

import com.chlitina.store.common.persistence.BaseDao;
import com.chlitina.store.common.persistence.BaseDaoImpl;
import com.chlitina.store.modules.cash.entity.StoreCardAll;

/**
 * StoreCardAll Dao 接口
 * @author Songsong.Xu
 * @version 2013-11-07
 */
public interface StoreCardAllDao extends StoreCardAllDaoCustom, CrudRepository<StoreCardAll, Long> {
	@Modifying
	@Query("from StoreCardAll where STORE_ID=?1")
	public List<StoreCardAll> findListByStore(long storeID);
	
	@Modifying
	@Query("from StoreCardAll where STORE_ID=?1 AND CUSTOMER_ID=?2")
	public List<StoreCardAll> findListByCustomer(long storeID,long customer);

}

/**
 * DAO自定义接口
 * @author Songsong.Xu
 */
interface StoreCardAllDaoCustom extends BaseDao<StoreCardAll> {

}

/**
 * DAO自定义接口实现
 * @author Songsong.Xu
 */
@Component
class StoreCardAllDaoImpl extends BaseDaoImpl<StoreCardAll> implements StoreCardAllDaoCustom {

}
